﻿Imports BE.BE
Imports BL.BL



Public Class frmGestionarExpedientes
    Dim mlista As New List(Of Expediente_BE)

    Private Sub btnNuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNuevo.Click
        frmAltaExpediente.MdiParent = frmPrincipal
        frmAltaExpediente.Show()
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim mExpediente As New Expediente_BE

        If Me.DataGridView1.SelectedRows.Count = 1 Then
            mExpediente.IdExpediente = Me.DataGridView1.SelectedRows(0).Cells(0).Value
        Else
            MsgBox("Debe seleccionar un expediente")
        End If



        frmSeguimientoExpediente.MdiParent = frmPrincipal
        frmSeguimientoExpediente.Expediente = mExpediente
        frmSeguimientoExpediente.Show()



    End Sub

    Private Sub frmGestionarExpedientes_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ' Helper_FL.setearPermisos(frmPrincipal.usr, Me)
        Try
            mlista = Expediente_BL.listarExpediente
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try


        Me.DataGridView1.DataSource = mlista
        Me.DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
        Me.DataGridView1.MultiSelect = False
        Me.DataGridView1.ReadOnly = True

    End Sub
End Class